﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using canthovieclam.BL;
using canthovieclam.BL.DataContact.Enum;
using canthovieclam.BL.DataContact.Filter;
using canthovieclam.Models;

namespace canthovieclam.Controllers
{
    public class AdminEmployerController : Controller
    {
        //
        // GET: /AdminEmployer/

        public ActionResult Index(EmployerModels employerModel, EmployerState? Id)
        {
            EmployerImpl employerImpl = new EmployerImpl();
            EmployerFilter employerFilter = new EmployerFilter();
            List<EmployerState> employerStatusList = new List<EmployerState>();
            if (Id != null)
            {
                employerStatusList.Add((EmployerState)Id);
            }
            else
            {
                employerStatusList.Add(EmployerState.Approved);
            }
            employerFilter.FilterByEmployerStatus = employerStatusList;
            employerModel.EmployerList = employerImpl.GetEmployerModelList(employerFilter);
            employerModel.EmployerStatusList = Enum.GetValues(typeof(EmployerState)).Cast<EmployerState>().ToList();
            return View(employerModel);
            return View();
        }

    }
}
